import api from '@/utils/request'

// 获取流程对应的变量
export const getAssignFlowVaries = (processKey: any, skipFirst?: any) => {
    if (skipFirst) {
        return api.get('/WorkFlow/variable/getProcessAssignVariable/?processKey=' + processKey + '&skipFirst=' + skipFirst)
    } else {
        return api.get('/WorkFlow/variable/getProcessAssignVariable/?processKey=' + processKey)
    }

}

// 保存或更新流程对应的变量
export const saveOrUpdateBatchProcessAssignVariable = (data: any) => {
    return api.post('/WorkFlow/variable/saveOrUpdateBatchProcessAssignVariable', data)
}

// 通过xml 在resource下的路径 部署流程
export const deployFlowViaXmlPath = (xmlPath: string, flowName: string) => {
    return api.post('/WorkFlow/process/deploy/xml?xmlPath=' + xmlPath + '&flowName=' + flowName)
}
// 通过xml 文件部署流程
export const deployFlowViaXmlFile = (file: any, flowName: string) => {
    return api.post('/WorkFlow/process/deploy/file?flowName=' + flowName, file)
}


// 获取流程对应的变量
export const getGateWayFlowVaries = (processKey: any) => {
    return api.get('/WorkFlow/variable/getProcessGateWayVariable/?processKey=' + processKey)
}
